package com.incar.chuxing.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.incar.chuxing.R;
import com.incar.chuxing.bean.TravelRecordBean;
import com.incar.chuxing.utils.TimeUtils;

import java.text.DecimalFormat;

/**
 * Created by CaoJing on 2016/10/5.
 */
public class TravelRecordAdapter extends BaseQuickAdapter<TravelRecordBean.AttachmentBean.CompleteOrderlListBean, BaseViewHolder> {
    public TravelRecordAdapter() {
        super(R.layout.item_my_route, null);
    }

    @Override
    protected void convert(final BaseViewHolder helper, TravelRecordBean.AttachmentBean.CompleteOrderlListBean item) {
        helper.setText(R.id.travel_date, TimeUtils.getFormatDate(item.getOrderTime() + "", "yyyy年M月d日H:mm"));
        helper.setText(R.id.travel_duration, TimeUtils.formatMinPlusOne((item.getEndBillingTime() - item.getStartBillingTime()) / 1000 + ""));
        DecimalFormat df = new DecimalFormat("0.00");
        String mileage = df.format(item.getMileage());
        helper.setText(R.id.travel_distance, mileage + "公里");
        helper.setText(R.id.travel_license, item.getCarModel().getLicenseTag());
    }

/*     case 0:
    orderStatus = "未取车";
                break;
            case 10:
    orderStatus = "用车中";
                break;
            case 15:
    orderStatus = "未结算";
                break;
            case 101:
    orderStatus = "已完成";
                break;
            case 102:
    orderStatus = "手动取消";
                break;
            case 103:
    orderStatus = "自动取消";
                break;
            case 104:
    orderStatus = "客服取消";
                break;*/


}
